package com.flying.fish.gateway.tiemr;

import com.flying.fish.gateway.service.load.InitClientService;
import com.flying.fish.gateway.service.load.InitSecureIpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Description 定时同步
 * @Author wondream322
 * @Date 2023/10/18
 * @Version V1.0
 */
@Slf4j
@Service
public class TimerSecureIpService {

    @Autowired
    InitSecureIpService initService;

    /**
     * 每1分钟执行一次同步
     */
    @Scheduled(cron = "0 * * * * ?")
    public void sync(){
        log.info("执行定时任务：同步到redis缓存...");
        initService.initLoadSecureIp();
    }



}
